package com.huanyang.cms.controller;


import com.huanyang.cms.protocol.vo.MenuVO;
import com.huanyang.cms.protocol.vo.WebSiteVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("content")
@Api(value = "内容管理系统", tags = "内容管理系统")
public class ContentController {

    @ApiOperation("菜单列表")
    @GetMapping("menu")
    public List<MenuVO> menus() {
        List<MenuVO> menus = new ArrayList<>();
        String[] menuNames = {"首页", "圈子", "商城", "消息", "问答" };
        for (int i = 0; i < menuNames.length; i++) {
            MenuVO menu = new MenuVO();
            menu.setId(i);
            menu.setName(menuNames[i]);
            menu.setDesc("");
            menu.setIcon(menuNames[i]);
            menus.add(menu);
        }
        return menus;
    }

    @ApiOperation("网站相关配置")
    @GetMapping("config")
    public WebSiteVO getConfig() {
        WebSiteVO webSite = new WebSiteVO();
        webSite.setTitle("");
        webSite.setDescription("");
        webSite.setBanner("");
        webSite.setIcp("");
        webSite.setContact("");
        webSite.setKeywords("");
        webSite.setVideoBanner("");
        webSite.setLogo("");
        return webSite;
    }
}
